

#include "stdlib.h"
#include "stdio.h"
#include "string.h"



//结构体的定义
typedef struct _AdvTeacher
{
	char name[64]; 
	char *tile;
	char **pStuArray;
	int age;
}Teacher ;


Teacher *creatTArray(int num)
{
	int i = 0, j = 0;
	Teacher *tArray = NULL;
	tArray = (Teacher *)malloc(num * sizeof(Teacher));
	if (tArray == NULL)
	{
		return NULL;
	}
	for (i=0; i<num; i++)
	{
		tArray[i].tile = (char *)malloc(100);
	}

	//创建老师带的学生
	for (i=0; i<num; i++)
	{
		char **ptmp = (char **)malloc((3+1)*sizeof(char *));
		for (j=0; j<3; j++)
		{
			ptmp[j] = (char *)malloc(120);
		}
		//ptmp[3] = NULL;
		tArray[i].pStuArray = ptmp;
	}

	return tArray;
}

void main()
{
	//定义一个结构体数组，给结构体数组元素赋值，给结构题排序。。。。打印
	
	int ret = 0;
	Teacher *pArray = NULL;

	pArray = creatTArray(3);
	if (pArray == NULL)
	{
		return ;
	}

	

	system("pause");
}
